public class test {
    public static void main(String[] args) {
        Geometry[] geometry = new Geometry[2];
        geometry[0] = new Square();
        geometry[1] = new Geometry() {
            @Override
            public double getArea() {
                return 50.24;
            }

            @Override
            public double getPerimeter() {
                return 25.12;
            }
        };
        for(int i = 0; i < 2; i++)
        {
            System.out.printf("面积为：%.2f   周长为：%.2f\n",geometry[i].getArea(),geometry[i].getPerimeter());
        }
    }
}
